package com.github.ecbp.user.service.service;

import com.github.ecbp.common.data.service.BaseService;
import com.github.ecbp.common.resp.NameVo;
import com.github.ecbp.common.security.vo.DefaultUserPermission;
import com.github.ecbp.user.service.dto.PermissionDto;
import com.github.ecbp.user.service.entity.TPermission;
import com.github.ecbp.user.service.response.PermissionRes;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 权限表 服务类
 * </p>
 *
 * @author zj2626
 * @since 2020-03-18
 */
public interface PermissionService extends BaseService<TPermission> {
    int create(PermissionDto param);

    boolean updateById(PermissionDto param);

    NameVo listDefault();

    PermissionRes getById(Long id);

    /**
     * 获取用户权限
     *
     * @param adminId
     * @param userPermission
     * @return java.util.List<com.ecbp.service.user.entity.TPermission>
     * @author zj2626
     * @date 2020/5/12
     */
    List<TPermission> getPermissionList(Long adminId, DefaultUserPermission userPermission);

    /**
     * 重新加载缓存中的用户权限
     *
     * @param ids
     * @return void
     * @author zj2626
     * @date 2020/5/12
     */
    void reloadUserPermission(Set<Long> ids);
}
